package com.tim.app.ui.view;

import android.content.Context;
import android.support.annotation.Nullable;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.View;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.application.library.runtime.event.EventManager;
import com.tim.app.R;
import com.tim.app.constant.EventTag;
import com.tim.app.server.entry.Special;

/**
 * 专题详情的header
 */

public class SpecialDetialHeadView extends RelativeLayout{

    public static final String TAG = "SpecialDetialHeadView";

    private TextView tvSpecialDesc;

    public SpecialDetialHeadView(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    protected void onFinishInflate() {
        super.onFinishInflate();
        tvSpecialDesc = (TextView) findViewById(R.id.tvSpecialDesc);
    }

    /**
     * 刷新页面
     *
     * @param data
     */
    public void setData(final Special data) {
        if (null == data)
            return;
        if (!TextUtils.isEmpty(data.getIntroduce())) {
            tvSpecialDesc.setText(String.valueOf(data.getIntroduce()));
        }
    }

}
